# #递归就是自己调用自己
# # def test():
# #     print('test')
# #     test()

# def jc(n):

#     if n==0:
#         return 1
#     return n * jc(n-1)

# print(jc(6))


# def add_1(n):
#     if n==0:
#         return 0
#     return n + add_1(n-1)
# print(add_1(5))




# # 随机函数
# def clc(a,b,fn):
#     c=fn(a,b)
#     return c

# # lambda
# x3=clc(5,2,lambda x,y:x-y)
# print(x3)


# nums=[2,3,5,1,8]
# nums.sort()
# print(nums)

# sorted(nums)
# print(nums)

# students=[
#     {'name':'zs','age':'14','match':'77'},
#     {'name':'zd','age':'24','match':'79'},
#     {'name':'zm','age':'15','match':'87'},
#     {'name':'zl','age':'12','match':'17'}
# ]

# # students.sort()
# # print(students)

# def foo(x):
#     print('{}'.format(x))
#     return x['age']

# students.sort(key=foo)
# print(students)


# filter()   #过滤
ages= [12,18,77,44,15,7,24]
# filters=filter(lambda ele:ele>16,ages)
# print(list(filters))
# # map()
# x1=map(lambda ele:ele-2,ages)
# print(list(x1))

from functools import reduce
# reduce()
print(reduce(lambda ele1,ele2:ele1+ele2,ages))